import pandas as pd
from pandas import DataFrame,Series
df = DataFrame({'姓名':['a','b'],'学号':['A1','A2'],'成绩1':[98,90],'成绩2':[87,80]})#输入数据
df = df.append({'姓名':'d','学号':'A4','成绩1':89,'成绩2':78},ignore_index=True)#插入数据
df.insert(4,'平均成绩',(df.成绩1+df.成绩2)/2)#添加平均成绩栏
sexsex = ['M','F','F']
df.insert(5,'性别',value=sexsex)#添加性别数据
print(df)
